<script type="application/xhtml+xml" id="component-form">
    <$ if(!noForm){
            form  =form||{};
            $>
    <form class='form-horizontal dialog-form <$=form.class1 $>' id="dialog-form<$=form.id$>" style="margin-top: 0px;">
    <$}$>
    <$
    list[list.length-1].btn = list[list.length-1].btn||{};
    list.map(function(item){
    if(item.type=='text'||item.type=='password'||item.type=='date'){
    $>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7 $>">
            <input type="<$=item.type=='date'?'text':item.type $>"
                   class="form-control <$=typeof item.validate != 'undefined'?item.validate:'' $> <$=typeof item.disabled != 'undefined'?(item.disabled?'disabled':''):'' $>"
            <$if( item.disabled != 'undefined'&&item.disabled){ $>disabled="disabled"<$}$>
            <$if( item.type == 'date'){ $>data-toggle="datepicker" readonly="true" style="background:#FFF;cursor: pointer;"<$}$>
            name="<$=item.name $>"
            placeholder="<$=item.placeholder $>"
            value="<$= typeof item.val != 'undefined' ?item.val : '' $>"
            <$ if(typeof item['dataErrormessage']=='object'){
            Object.keys(item['dataErrormessage']).map(function(key){
            $>
            data-error-message-<$=key$>="<$=item['dataErrormessage'][key]$>"
            <$})}$>

            id="<$=item.id||('ele'+fnGenId())$>"

            />
        </div>
        <$ if(item.sendCode){ $>
        <div class="col-xs-<$=item.codeNum||5 $>">
            <a href="javascript:void(0)" class="btn btn-default code-btn <$=item.sendCode $>">获取验证码</a>
        </div>
        <$}$>
        <$ if(item.checkbox){ $>
        <div class="col-xs-<$=item.checkbox.num||5 $>">
            <input type="checkbox" name="<$=item.checkbox.name $>"/> &nbsp;&nbsp;<$=item.checkbox.label $>
        </div>
        <$}$>
    </div>
    <$}else  if(item.type=='tags'){
    item.list.map(function(it,index1){ $>
    <span class="tag <$=item.validate $>" style="<$=(index1+1)%5==0?'margin-right:0':''$>"><$=it$></span>

    <$})
    }else  if(item.type=='swiper-tags'){ $>
    <div>
        <div class="swiper-container">
            <div class="swiper-wrapper" style="padding: 0;">
                <$item.list.map(function(it,index1){ $>
                <$if((index1==0)){$>
                <div class="swiper-slide">
                    <$}$>

                    <span class="tag <$=item.validate $>" style="<$=(index1+1)%(item.lineNum||5)==0?'margin-right:0':''$>"><$=it$></span>

                    <$if((index1!=0)&&((index1+1)%(item.lineNum||5)==0)){$>
                </div><div class="swiper-slide">
                <$}$>

                <$})$>
            </div>
            </div>
        </div></div>
    <$}else  if(item.type=='avatar'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num?item.num:7 $>">
            <img class="<$=item.validate$>"
                 style="width:150px;height:150px;"
                 src="/imgs/login/avatar.png" alt="">
        </div>
    </div>
    <$}else  if(item.type=='textarea'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num?item.num:7 $>">
            <textarea
                    name="<$=item.name $>"
                    placeholder="<$=item.placeholder $>"
                    value="<$=item.val||'' $>"
                    class="form-control <$=item.validate$>" ><$=item.val||'' $></textarea>
        </div>
    </div>
    <$}else if(item.type=='select'){$>
    <div class="form-group">
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <div class="col-xs-7">
            <select class="form-control"
                    name="<$=item.name $>"
                    placeholder="<$=item.placeholder $>"></select>
        </div>
    </div>
    <$}else if(item.type=='checkbox'){$>
    <div class="form-group">
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <div class="col-xs-<$=item.num||7 $>">
            <$ item.val.map(function(item1){$>
            <label class="checkbox-inline">
                <input  type="<$=item.type $>"
                        name="<$=item.name $>"
                        value="<$=item1.id $>" /> <$=item1.name $>
            </label>
            <$})$>
        </div>
    </div>
    <$}else if(item.type=='radio'){$>
    <div class="form-group">
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <div class="col-xs-<$=item.num||7 $>">
            <$ item.val.map(function(item1){$>
            <label class="checkbox-inline">
                <input  type="<$=item.type $>"
                        name="<$=item.name $>"
                        value="<$=item1.val $>" /> <$=item1.name $>
            </label>
            <$})$>
        </div>
    </div>
    <$}else if(item.type=='remember'){ $>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-3 control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7 $>">
            <input type="checkbox"/> 自动登录
            <a class="fr" href="<$=item.url$>">忘记密码</a>
        </div>
    </div>
    <$}else if(item.type=='upload-dialog'){$>
    <div class="form-group" style="margin-top:10px;">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum ||3$> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7$>">
            <%-include('./jcrop.html') %>
            <div   class="upload-select <$=item.btnClass $>">选择上传</div>
        </div>
    </div>
    <$} else if(item.type=='upload-btn'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum ||3$> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7$>">
            <$if(item.uploadFile){ $>
                <div><img src="<$=item.val||'../../imgs/upload/UPLOAD.png'$>" alt="" class="<$=item.previewClass$>"/></div>
            <$}$>
            <$if(!item.uploadFile){ $>
                <div><img src="<$=item.val||'../../imgs/upload/UPLOAD.png'$>" alt="" class="<$=item.previewClass$>"/></div>
            <$}$>
            <div style="margin: 10px 0;" class="upload-select btn <$=item.btnClass $>">选择上传</div>
            <br/>
        </div>
    </div>
    <$} else if(item.type=='upload'){$>
    <div class="form-group" style="margin: 50px 0px;">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||'3' $> control-label"><$=item.label $></label>
        <$}$>
        <div class=" col-xs-<$=item.num||'9 col-xs-offset-1'$>">
            <%-include('./jcrop.html') %>
            <div class="upload-select"></div>
        </div>
    </div>
    <$} else if(item.type=='editor'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum$> control-label"><$=item.label $></label>
        <$}$>
        <div class=" col-xs-<$=item.num||'11 col-xs-offset-1'$>" style="padding-bottom:30px">
            <div class="editor" id="<$=item.editorId$>"> </div>
        </div>
    </div>
    <$}})
    $>

    <$ if(!noForm){ $>
    <div class="form-group">
        <div class="col-xs-<$=typeof list[list.length-1].btn.num !='undefined'?list[list.length-1].btn.num:'9 col-xs-offset-3'$>">
            <button type="submit" class="btn btn-primary <$=typeof list[list.length-1].btn.class_ !='undefined'?list[list.length-1].btn.class_:'' $>" name="submit" value="提 交"><$=typeof list[list.length-1].btn.label !='undefined'?list[list.length-1].btn.label:' 提 交 '$></button>
        </div>
        <$-typeof list[list.length-1].btn.html !='undefined'?list[list.length-1].btn.html:''$>
    </div>
    </form>
    <$}$>
</script>